import request from '@/utils/request'
import { getApiUrl, API_CONFIG } from './config'

export function getJobKeywords(){
  return request({ url: getApiUrl('/job/keywords'), method: 'get' })
}

export function getJobList(params){
  return request({ url: getApiUrl('/job/list'), method: 'get', params })
}

export function getJobListByType(params){
  return request({ url: getApiUrl('/job/listByType'), method: 'get', params })
}

export function getCitySalaryDistribution(params){
  return request({ url: getApiUrl('/job/citySalaryDistribution'), method: 'get', params })
}

export function getPmTopSkills(){
  return request({ url: getApiUrl('/job/pmTopSkills'), method: 'get' })
}

// 点赞相关
export function getJobLikes(jobId, config){
  return request({ url: getApiUrl(`/job/likes/${jobId}`), method: 'get', ...(config||{}) })
}
export function toggleJobLike(jobId, config){
  return request({ url: getApiUrl(`/job/like/${jobId}`), method: 'put', ...(config||{}) })
}

// 收藏相关
export function getJobFavorites(jobId, config){
  return request({ url: getApiUrl(`/job/favorites/${jobId}`), method: 'get', ...(config||{}) })
}
export function toggleJobFavorite(jobId, config){
  return request({ url: getApiUrl(`/job/favorite/${jobId}`), method: 'put', ...(config||{}) })
}


